import request from '@/utils/myrequest'

// 获取所有的Role
export function getList(kvs) {
  return request({
    url: 'config/role/getlist',
    method: 'get',
    kvs
  })
}

export function add(kvs) {
  return request({
    url: 'config/role/add',
    method: 'post',
    kvs
  })
}

export function get(kvs) {
  return request({
    url: 'config/role/get',
    method: 'get',
    kvs
  })
}

export function del(kvs) {
  return request({
    url: 'config/role/delete',
    method: 'post',
    kvs
  })
}

export function edit(kvs) {
  return request({
    url: 'config/role/update',
    method: 'post',
    kvs
  })
}

export function editMenu(kvs) {
  return request({
    url: 'config/role/editrolemenu',
    method: 'post',
    kvs
  })
}

export function getMenuIdsByRoleId(kvs) {
  return request({
    url: 'config/role/GetMenuIdsByRoleId',
    method: 'get',
    kvs
  })
}

export function getAllRoles() {
  return request({
    url: 'config/role/getall',
    method: 'get'
  })
}

export function getUserRoles(kvs) {
  return request({
    url: 'config/user/getUserRoles',
    method: 'get',
    kvs
  })
}

export default { getList, add, edit, del, get, editMenu, getMenuIdsByRoleId, getAllRoles, getUserRoles }
